﻿/**
 * @brief 材料热膨胀系数界面
 * @author BaGuijun (baguijun@163.com)
 * @date 2024-06-20
 */
#ifndef _MaterialExpamsionWidget_H
#define _MaterialExpamsionWidget_H

#include "MaterialWidgetBase.h"
#include "FITK_Interface/FITKInterfaceStructural/FITKAbaMaterialBehavior.h"

namespace Ui {
    class MaterialExpamsionWidget;
}

namespace Interface {
    class FITKAbaMaterialExpansion;
}

namespace GUI
{
    /**
     * @brief 材料热膨胀系数界面
     * @author BaGuijun (baguijun@163.com)
     * @date 2024-06-20
     */
    class MaterialExpamsionWidget :public MaterialWidgetBase
    {
        Q_OBJECT;
    public:
        /**
         * @brief Construct a new Material Expamsion Widget object
         * @param[i]  item           材料对象
         * @param[i]  parent         父对象
         * @author BaGuijun (baguijun@163.com)
         * @date 2024-06-20
         */
        MaterialExpamsionWidget(EventOper::ParaWidgetInterfaceOperator * oper,Interface::FITKAbaMaterialExpansion* item, QWidget* parent = nullptr);
        /**
         * @brief Destroy the Material Expamsion Widget object
         * @author BaGuijun (baguijun@163.com)
         * @date 2024-06-20
         */
        ~MaterialExpamsionWidget();
        /**
         * @brief 数据检查
         * @return true 成功
         * @return false 失败
         * @author BaGuijun (baguijun@163.com)
         * @date 2024-06-12
         */
        bool checkValue() override;
        /**
         * @brief 存储数据
         * @return true 成功
         * @return false 失败
         * @author BaGuijun (baguijun@163.com)
         * @date 2024-06-12
         */
        bool saveValue() override;
    private slots:
        ;
        /**
         * @brief 材料类型选择事件
         * @param[i]  index          材料类型索引
         * @author BaGuijun (baguijun@163.com)
         * @date 2024-06-20
         */
        void on_comboBox_type_activated(int index);
        /**
         * @brief 材料温度选择按钮点击事件
         * @param[i]  checked        是否点击
         * @author BaGuijun (baguijun@163.com)
         * @date 2024-06-20
         */
        void on_checkBox_temp_clicked(bool checked);
    private:
        /**
         * @brief ui初始化
         * @author BaGuijun (baguijun@163.com)
         * @date 2024-06-20
         */
        void initUi();
        /**
         * @brief 根据类型显示子模块数据
         * @param[i]  type           模块类型
         * @author BaGuijun (baguijun@163.com)
         * @date 2024-06-20
         */
        void showValue(Interface::FITKAbaMaterialBehaviorEnum::FITKAbaMaterialExpansionType type);
        /**
         * @brief 根据类型存储子模块数据
         * @param[i]  type           模块类型
         * @author BaGuijun (baguijun@163.com)
         * @date 2024-06-20
         */
        void saveValue(Interface::FITKAbaMaterialBehaviorEnum::FITKAbaMaterialExpansionType type);
        /**
         * @brief 材料类型修改逻辑处理
         * @param[i]  type           模块类型
         * @author BaGuijun (baguijun@163.com)
         * @date 2024-06-20
         */
        void changeMaterialElasticType(Interface::FITKAbaMaterialBehaviorEnum::FITKAbaMaterialExpansionType type);
        /**
         * @brief 材料温度修改逻辑处理
         * @param[i]  type           模块类型
         * @param[i]  isTemp         是否使用温度
         * @author BaGuijun (baguijun@163.com)
         * @date 2024-06-20
         */
        void changeMaterialTemp(Interface::FITKAbaMaterialBehaviorEnum::FITKAbaMaterialExpansionType type, bool isTemp);
    private:
        //热膨胀系数对象
        /**
         * @brief 材料热膨胀系数对象
         * @author BaGuijun (baguijun@163.com)
         * @date 2024-06-20
         */
        Interface::FITKAbaMaterialExpansion* _materialItem = nullptr;
        /**
         * @brief ui对象
         * @author BaGuijun (baguijun@163.com)
         * @date 2024-06-20
         */
        Ui::MaterialExpamsionWidget* _ui = nullptr;
    };
}
#endif
